import java.util.Scanner;

public abstract class Text1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("——————欢迎进入加密解密系统——————");
        System.out.println("a.加密");
        System.out.println("b.解密");
        System.out.println("请输入上方功能前的序号选择：");
        String n=sc.nextLine();
        switch (n){
            case "a":
                System.out.println("请输入要加密的字符串：");
                String plaintext1 = sc.nextLine();
                Encryption p1 = new Encryption();
                String ciphertext1 = p1.encrypt(plaintext1);
                System.out.println("加密后的密文为:"+ciphertext1);
                break;
            case "b":
                System.out.println("请输入要解密的字符串：");
                String ciphertext2 = sc.nextLine();
                Encryption c1 = new Encryption();
                String plaintext2 = c1.decrypt(ciphertext2);
                System.out.println("解密后的明文为:"+plaintext2);
                break;
            default:
                System.out.println("功能选择输入错误");
        }
    }
}

